package org.example.job;

import org.example.service.JobTaskService;
import org.example.service.ShutTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @Author: WangShengJie
 * @Date: 2025/8/6
 */
@Component
public class ShutDownPool {
    @Autowired
    private ShutTaskService shutTaskService;

    @Scheduled(cron = "0 * * * * ?")
//    @Async
    //使用@Async注解需要自定线程池。推荐通过ThreadPoolTaskExecutor自定义核心线程数、队列容量等
    public void printDemo() throws InterruptedException {
        shutTaskService.shutDownTest();
    }
}
